import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/admin',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/AdminView.vue'),
        children: [
            {
                path: '/admin/base/building',
                component: () => import('../views/BuildingView'),
            },
            // {
            //     path: '/admin/base/floor',
            //     component: () => import('../views/BuildingView'),
            // },
            {
                path: '/admin/core/parkingCharge',
                component: () => import('../views/ParkingCharge'),
            },
            {
                path: '/admin/core/propertyCharges',
                component: () => import('../views/PropertyCharge'),
            },
            {
                path: '/admin/core/complaint',
                component: () => import('../views/ComplaintView.vue'),
            },
            {
                path: '/admin/core/repairInformation',
                component: () => import('../views/repairInformation.vue'),
            },
            {
                path: '/admin/base/house',
                component: () => import('../views/HouseView'),
            },
            {
                path: '/admin/data/reportForRepair',
                component: () => import('../views/ReportForRepairView'),
            },
            {
                path: '/admin/base/meter',
                component: () => import('../views/MeterView'),
            },
            {
                path: '/admin/base/home',
                component: () => import('../views/HomeView'),
            },
            {
                path: '/admin/base/owner',
                component: () => import('../views/OwnerView'),
            },
            {
                path: '/admin/base/parking',
                component: () => import('../views/ParkingView'),
            },
            {
                path: '/admin/data/complaintStatistics',
                component: () => import('../views/ComplaintStatisticsView'),
            },
            {
                path: '/admin/base/administrators',
                component: () => import('../views/AdministratorsView'),
            },
            {
                path: '/admin',
                component: () => import('../views/HomeView'),
            },


        ]
    },
    {
        path: '/user',
        name: 'user',
        component: () => import('../views/userView.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
